package com.iot08.common.entity.admin;

import lombok.Data;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @version 1.0
 * @Description: 菜单实体
 * @author: Rock
 * @time: 2020/8/12 15:13
 */
@Data
@Document("sys_menu")
public class SysMenu implements Serializable {
    private static final long serialVersionUID = 1L;

    @Field("_id")
    private String id;

    /**
     * 父级id
     */
    private String pid;

    /**
     * 菜单名称
     */
    private String name;

    /**
     * 菜单url
     */
    private String url;

    /**
     * 按钮类型；1=路径；2=菜单；3=按钮
     */
    private Short type;

    /**
     * 菜单排序，越小越靠前
     */
    @Field("order_num")
    private Integer orderNum;

    /**
     * 0=正常；1=删除
     */
    private Short deleted;

    private String creator;

    @Field("create_date")
    private Date createDate;

    @Field("update_date")
    private Date updateDate;

    @Transient
    private List<SysMenu> subMenu;
    @Transient
    private SysMenu pmenu;

}


